import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

// 修改注册状态
export function registerStatus(data) {
  return request({
    url: '/users/registerStatus',
    method: 'post',
    data
  })
}

// 修改专家类型
export function expertType(data) {
  return request({
    url: '/users/expertType',
    method: 'post',
    data
  })
}

// 修改专家类型
export function updateUser(data) {
  return request({
    url: '/users',
    method: 'put',
    data
  })
}

// 获取用户列表
export function userList(params) {
  return request({
    url: '/users',
    method: 'get',
    params
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
